{extend name="homePage/userPage" /}
{block name="css"}
{/block}
{block name="main"}
    <div style="border:1px solid #ccc">
        <form class="form-horizontal" method="post" action="{:url('index/Document/pushdocument')}" enctype="multipart/form-data" >
                <p style="font-size:19px">上传文书:</p>
                <input type="hidden" name="id" value="{$user.id}">
                <input type="hidden" name="classid" value="{$user.class}">
                <div class="form-group">
                    <label for="exampleInputAccount4" class="col-sm-2">文件名</label>
                    <div class="col-md-6 col-sm-10">
                      <input type="text" class="form-control " id="exampleInputAccount4" name="name" >
                    </div>
                </div>
                <div class="form-group">
                    <label for="exampleInputAccount4" class="col-sm-2">文件类型</label>
                    <div class="col-md-6 col-sm-10">
                      <select name="type" id="" class="chosen-select form-control type">
                          <option value="1">个人申请</option>
                          <option value="2">部门内部文件</option>
                          <option value="3">部门交互文件</option>
                      </select>
                    </div>
                </div>
                <div class="form-group hidden yzclass">
                    <label for="exampleInputAccount4" class="col-sm-2">送达部门 </label>
                    <div class="col-md-6 col-sm-10">
                      <select name="outcid" id="" class="chosen-select form-control yzclass " >
                            {volist name="classlist" id="vo"}
                            {if condition="$vo['id'] neq $user['class']"}
                            <option value="{$vo.id}" >{$vo.name}</option>
                            {else/}
                            <!-- <option value="{$vo.id}" >{$vo.name}</option> -->
                            {/if}
                            {/volist}
                      </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="exampleInputAccount4" class="col-sm-2">选择文件</label>
                    <div class="col-md-6 col-sm-10">
                        <input type="file" name="content">
                    </div>
                </div>
               
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                    <input type="submit" class="btn btn-info" >
                    <input type="reset" class="btn btn-info" >
                    </div>
                </div>
        </form>

    </div>

{/block}
{block name="js"}
    <script type="text/javascript">
        $('.type').change(
            function(){
                var typeval = $('.type').val()
                // alert(typeval);
                if(typeval==3){
                    $('.yzclass').removeClass('hidden');
                }else{
                    $('.yzclass').addClass('hidden');
                }
        });
    </script>
{/block}

